home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
keyb
/
cedwars2.zip
/
CED.ART
< prev
next >
Wrap
Text File
|
1987-11-15
|
17KB
|
387 lines
Living With DOS: CED, the Command Editor
by Barry Simon
Copyright (c) 1986, Capital PC User Group Inc.
This material may be republished only for internal use
by other not-for-profit user groups.
Posted on Compuserve with permission of CPCUG. May not be
reproduced without including the above copyright notice.
Published in the January 1986 issue of the Capital PC Monitor.
This article is the second in a series that discusses products
and utilities that enhance the usefulness and ease of use of
DOS, the Disk Operating System. This article discusses a
program called CED (for Command EDitor) by Chris Dunford. CED
remains loaded in memory and available while you are in DOS and
in some additional programs like EDLIN and DEBUG; it sits
between the commands you type in and DOS.
CED is the kind of program that you can't do without once you
start using it. Indeed, if I were travelling somewhere and were
told that I'd have a PC with only the basic application
software, the first utility I would be sure to bring along would
be CED.
CED was originally placed in the public domain by its author.
An enhanced version, PROFESSIONAL CED, was recently introduced
as a commercial product. This review discusses the public
domain version of CED, version 1.0D; some of the enhanced
features of the commercial version will be described in a
separate article that will appear in a future issue of the
MONITOR.
OVERVIEW
CED provides four major facilities:
1. command editing
2. a command stack or buffer
3. recalling a program with the same parameters
4. synonyms
Imagine exiting your word processor after working on a letter or
document. You enter a command in DOS, perhaps copying a file to
the directory where you have your spelling checker, a directory
with a long path name. Before hitting <enter>, you scan the
command and discover a typing error in the middle.
Unfortunately, DOS does not have a full-function command editor
so you cannot go back and edit the command as you can with a
word processor; instead, you have to retype the correct command.
CED resolves this problem by providing a command editing
capability for DOS.
And, having learned to use the DOS editing keys (F1, F3) to
avoid having to retype the last command, haven't you wished that
you had the capability to recall the command that was made the
one before the last one or even six commands ago? That's what
the command stack is all about.
And having used your word processing program to edit a file
"therise.and", haven't you wished that you could call up the
program on this last used file without having to remember the
precise file name. That's what parameter recall is all about.
And aren't there some long commands that you're tired of typing
and you wish you could abbreviate them or use shorthand
notations for them? That's what the synonyms are all about --
creating macros as shorthand methods for issuing a set of
commands.
The Command Line Editor
The command editor provides most of the features that you would
want and expect in editing the current line. You can move the
cursor non-destructively with the <left-> and <right-arrow> keys
and use the <delete> key to delete the character at the cursor.
In the default mode, striking a key overwrites the character at
the cursor, i.e., replaces the character at the cursor with the
character that was struck. The <insert> key toggles between
this mode and an insert mode where the key struck is inserted
just before the cursor. The <home> and <end> keys take the
cursor to the beginning and end of the line respectively.
<Ctrl-End> erases from the cursor to the end of the line; <Ctrl-
left-> and <Ctrl-right-arrow> move the cursor a word at a time.
The editing keys are helpful in normal use but are especially
useful because you can recall previous commands from a stack and
edit them. For example, PC-WRITE has an editing program called
ed.exe and a printing program called pr.exe. After exiting the
editor which you called up with ed FILENAME, you need only
recall this command from the stack, hit <home>, then "pr" and
finally <enter> to issue the command pr FILENAME.
The Command Stack
The <left-> and <right-arrow> keys move the cursor in the
obvious manner. It would be useful to have full-screen editing
in DOS so that one could use the up and down cursor to move
around the screen reissuing commands. In many ways, the command
stack does precisely that; however, it also allows you to use
commands that have scrolled off the screen!
When CED is invoked, it reserves 2K of memory (this number can
be modified) to store the last 2,000 characters sent as commands
to DOS. After issuing a new command, the <up-arrow> key
restores that command to the command line. If you just <enter>
without any editing of the command line, you move one position
down in the stack; that is, the <up-arrow> key recalls the
command just issued and the <down-arrow> key recalls the next
command in the stack. This is especially convenient for
recycling a series of commands.
If you should change your mind while you're in the stack, you
can press the <esc> key to blank the command line.
The stack idea is enhanced with many thoughtful extras which are
typical of the CED program. One is the "ignore character". The
ignore character tells CED not to include in the stack the
command that follows. The default value for the ignore
character is <Ctrl-N> or ^N (* in PROFESSIONAL CED) but that can
be changed by the user. If, for example, you enter "dir" at the
command line, the command is added to the stack. However, by
entering "^Ndir", the command is issued to DOS but is not placed
in the stack.
This is especially useful for key redefinitions. I have defined
<F1> to mean "dir^" (where ^ means <enter>). Because I can get
that command by hitting <F1>, there is no reason to stack it, so
<F1> is really defined to CED as "^Ndir^". In general, you
should only do this with redefinitions that end in <enter>. For
example, my <Alt-F1> key means "dir[]" where [] means space.
Since I would want to recall a command such as "dir
C:\bin\dump\vdump\ce*.*", I do not put a ^N before that dir.
Another use for the ignore character is to stack synonyms. As
I'll explain shortly, you can set up lists of short names for
commands or sets of commands that you use often. If there are
sets of commands, both the synonym and the individual commands
get stacked; depending upon the size of your commands, this
could fill up the stack. Thus, you would want to include the
ignore character before the individual commands in your synonym
definitions. [This is not necessary in PROFESSIONAL CED because
the commands within synonyms are NOT stacked.] WARNING: Because
of the way CED processes the ignore character, you should not
include it in front of the first command in a multiple command
synonym nor in front of a command which is a synonym if you have
nested synonyms.
Parameter Recall
One can tell CED that one wishes to have certain programs
normally called up with the same parameters that were used the
last time the program was loaded during the current seesion.
Thus, if your word processor is called ed.exe and you issue the
command
ced pcall ed
then this feature is made available for the command "ed". If
you enter the command "ed oldfile newfile", CED stores the
"oldfile newfile". The next time you type "ed" followed by
<Enter>, CED will resupply these parameters by flashing them on
the screen and passing them to the ed-program. If you want to
apply ed to another file, typing "ed newerfile" does precisely
what you want and stores "newerfile" in the pcall buffer. If
you want to invoke ed without any parameters, typing "ed " (note
the space) followed by <Enter> will work. The pcalled command
can be a CED synonym.
Loading CED and Issuing Commands to It
The final feature of CED is its "synonyms". Before explaining
this, it is first necessary to explain how you issue commands to
CED. There are two w